package com.ucap.weking.guangan.fragments;

import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;

import com.ucap.weking.guangan.R;
import com.ucap.weking.guangan.adapter.ViewPagerAdapter;
import com.ucap.weking.guangan.base.BaseFragment;
import com.ucap.weking.guangan.dataUri.DataUri;
import com.ucap.weking.guangan.fragments.fragmentContent.HomeContent2Company;
import com.ucap.weking.guangan.fragments.fragmentContent.HomeContent2Laeder;
import com.ucap.weking.guangan.fragments.publicFragment.HomeContentPublic;

import java.util.ArrayList;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Created by weking on 2017/10/17.
 */

public class HomeContent2 extends BaseFragment {

    @InjectView(R.id.tab)
    TabLayout tabLayout;
    @InjectView(R.id.vp_content)
    ViewPager vpContent;

    @Override
    public void setData() {
        ArrayList<Fragment> mContent = new ArrayList<>();
        mContent.add(new HomeContent2Laeder());
        mContent.add(new HomeContent2Company());
        mContent.add(new HomeContentPublic().setInfo(DataUri.getCHANG_WU_HUI_YI(), "常务会议", false));
        mContent.add(new HomeContentPublic().setInfo(DataUri.getZHENG_FU_WEN_JIAN(), "政府文件"));
        mContent.add(new HomeContentPublic().setInfo(DataUri.getGONG_SHI_GONG_GAO(), "公示公告"));
        mContent.add(new HomeContentPublic().setInfo(DataUri.getREN_SHI_JI_ZHAO_KAO(), "人事及招考"));
        String[] title = {"政府领导", "政府机构", "常务会议", "政府文件", "公式公告", "人事及招考"};
        tabLayout.setupWithViewPager(vpContent);
        vpContent.setAdapter(new ViewPagerAdapter(getActivity().getSupportFragmentManager(), mContent, title));
    }

    @Override
    public void intiView() {
        View view = LayoutInflater.from(getContext()).inflate(R.layout.frgament_home_content1, null);
        flContent.addView(view);
        ButterKnife.inject(this, view);
    }
}
